import request from '@/utils/request'

// 查询隐患上报列表
export function listRisk(query) {
  return request({
    url: '/work/risk/list',
    method: 'get',
    params: query
  })
}

// 查询隐患上报详细
export function getRisk(riskId) {
  return request({
    url: '/work/risk/' + riskId,
    method: 'get'
  })
}

// 新增隐患上报
export function addRisk(data) {
  return request({
    url: '/work/risk',
    method: 'post',
    data: data
  })
}

// 修改隐患上报
export function updateRisk(data) {
  return request({
    url: '/work/risk',
    method: 'put',
    data: data
  })
}

// 删除隐患上报
export function delRisk(riskId) {
  return request({
    url: '/work/risk/' + riskId,
    method: 'delete'
  })
}

// 提交审核
export function submit(riskId) {
  return request({
    url: '/work/risk/submit/' + riskId,
    method: 'put',
  })
}

// 撤销审核
export function revoke(riskId) {
  return request({
    url: '/work/risk/revoke/' + riskId,
    method: 'put',
  })
}

// 重新申请
export function reapply(riskId) {
  return request({
    url: '/work/risk/reapply/' + riskId,
    method: 'put',
  })
}
